<?php

namespace app\admin\controller;
use app\common\controller\Backend;
use think\Db;
use think\Request;
use think\Controller;

class Qrcode extends controller{

    /**
     * @return \think\response\Json|void
     * 生成二维码
     */
    protected $noNeedRight = ['*'];
    protected $noNeedLogin = ['*'];

    public function index($taskId)
    {
        $obj = new \app\admin\controller\wechat\Index();
        $value = $obj->getQRCode($taskId);
        print_r($value);exit;

//        $errorCorrectionLevel = "M"; // 纠错级别：L、M、Q、H
//        $matrixPointSize = "10"; // 点的大小：1到10
//        $qr = new \fast\Qrcode();
//        ob_clean(); //这个很重要
//        $res = $qr::png($value,false, $errorCorrectionLevel, $matrixPointSize, 2);
//        print_r($res);exit;
    }


    public function addTaskWx($data)
    {
        if(Db::table('fa_task_wx')->insert($data)){
            return 'success';
        }else{
            return 'false';
        }
    }


}